var see=true;

/* Toast --start */
function toastMsg(msg) {
    if (see === true) {
        see=false;
        var msgDiv = '<div id="toastMessage" class="toast-message">' + '<img src="fonts/提示.svg" alt="提示" width="20" height="20"' +
            ' style="margin-right: 10px;margin-top:-5px" ' +
            '<span>' + msg + '</span>' + '<span>' + '<img src="imgs/取消.png" alt="取消" width="20" height="20" ' +
            'style=" margin-top: -4px; margin-left: 8px" id="clear_Message">' + '</span>' +
            '</div>';
        $("body").append(msgDiv);

        document.getElementById('clear_Message').onclick = clear_alert;

        //set #toastMessage of top
        //计算屏幕的高度，并让toast提示框显示在屏幕的中间
        var toastMessage = $("#toastMessage");
        var top = $("#mgy_menu");
        toastMessage.css("top", top);

        setTimeout(function () {
            $("#toastMessage").remove();
            see=true;
        }, 5000);
    }
}
/* Toast --end */

function clear_alert() {
    $("#toastMessage").remove();
}





